using System.Collections.Generic;
using System.IO;

namespace Lottery.Client.SL
{
    public class WinTypeInfoControl
    {
        public static WinTypeInfo GetLotteryWinTypeInfo(int wintypeid)
        {
            using (List<WinTypeInfo>.Enumerator enumerator = DataCache.WinTypeDatas.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    WinTypeInfo current = enumerator.Current;
                    if (current.ID == wintypeid)
                    {
                        return current;
                    }
                }
            }
            return null;
        }
        public static WinTypeInfo GetWinTypeDatas(BinaryReader br)
        {
            return new WinTypeInfo
                       {
                           ID = br.ReadInt32(),
                           Scale = br.ReadDouble(),
                           ScaleBase = br.ReadDouble(),
                           ScaleType = br.ReadInt16()
                       };
        }
    }
}